import request from '@/utils/request'

enum API {
  baseTrademarkGet = '/admin/product/baseTrademark/',
  baseTrademarkSave = '/admin/product/baseTrademark/save',
  baseTrademarkUpdate = '/admin/product/baseTrademark/update',
  baseTrademarkUpdateDel = '/admin/product/baseTrademark/remove/',
}
export const reqBaseTrademark = (page: number, limit: number) =>
  request.get(API.baseTrademarkGet + `${page}/${limit}`)

export const reqBaseTrademarkSave = (data: any) => {
  if (data.id != '') {
    return request.put(API.baseTrademarkUpdate, data)
  } else {
    return request.post(API.baseTrademarkSave, data)
  }
}

export const reqBaseTrademarkUpdateDel = (id: number) =>
  request.delete(API.baseTrademarkUpdateDel + id)
